﻿<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<script type="text/javascript" src="../jslib/EventUtil.js"></script>
	</head>
	<body>
		<div id="console"></div>
		<script type="text/javascript">
		function handlerTouchEvent(event){
			if(event.touches.length == 1){
				var out = document.getElementById("console");
				switch(event.type){
					case "touchstart":
						out.innerHTML = "Touch started ("+ event.touches[0].clientX + "," + event.touches[0].clientY + ")";
						break;
					case "touchend":
						out.innerHTML = "<br/> Touch ended (" + event.changedTouches[0].clientX + "," + event.changedTouches[0].clientY + ")";
						break;
					case "touchmove":
						event.preventDefault();
						out.innerHTML += "<br/>Touch moved (" + event.changedTouches[0].clientX + "," + event.changedTouches[0].clientY + ")";
						break;
				}
			}
		}
		EventUtil.addHandler(document,"touchstart",handlerTouchEvent);
		EventUtil.addHandler(document,"touchend",handlerTouchEvent);
		EventUtil.addHandler(document,"touchmove",handlerTouchEvent);
		</script>
	</body>
</html>